<?php
/*
	区域代理中心
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();
$return['pluginset']=$this->setting;
if($_RQ['op']=='main'){
	$return['setting']=$this->plugin_setting('page');
	set_html('title',$return['setting']['center']);
	$member=$this->get('member',array('mid'=>$_SESSION['uid'],'merchid'=>$_SESSION['onemerchid']));
	$level_id=$this->getcolumn('agent_area',array('mid'=>$_SESSION['uid'],'merchid'=>$_SESSION['onemerchid']),'level_id');
	$member['leveltitle']=$this->getcolumn('level',array('id'=>$level_id),'title');
	$member['leveltitle']=$member['leveltitle']?:'默认等级';
	if($_SESSION['onemerchid']){
		$basic=model('jy_merch/member')->getdetail($_SESSION['onemerchid'],$_SESSION['uid']);
		$basic2=model('core/member')->detail($_SESSION['uid'],array('avatar','nickname'));
		$basic=array_merge($basic2,$basic);
	}else{
		$basic=model('core/member')->basic($_SESSION['uid']);
	}
	$member=array_merge($member,$basic);
	$return['member']=$member;
	$data=array();
	$data['order_num']=pdo_count('jy_merch_creditlog',array('merchid'=>$_SESSION['onemerchid'],'plugin'=>'jy_area_jifee','uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']),'id');
	$data['commission_total']=pdo_getsum('jy_merch_creditlog',array('merchid'=>$_SESSION['onemerchid'],'plugin'=>'jy_area_jifee','uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']),'fee');
	$data['area_num']=pdo_count('jy_area_jifee_agent_area',array('merchid'=>$_SESSION['onemerchid'],'uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']));
	$return['data']=$data;
	$return['data']=$data;
	$return['xuniname']=$this->xuniname;
	exi($return);
}

?>